/**
 * 
 */
package unitTests;


import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;

import datamodels.Conference;
import datamodels.Role;
import datamodels.User;

/**
 * A test class for testing Addmenuscript method.
 * @author rithychhen
 * @version 11/19/2011
 */
public class TestAddManuscript {
	
	protected User my_user1, my_user2, my_user3, my_user4;
	
	// conference
	protected Conference con;
	
	//the texts. 
	protected String my_text1, my_text2, my_text3, my_text4;

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp(){
		my_user1 = new User("Rithy");
		my_user1.setCurrentRole(Role.AUTHOR);
		my_user2 = new User("Zach");
		my_user2.setCurrentRole(Role.AUTHOR);
		my_user3 = new User("Anthony");
		my_user3.setCurrentRole(Role.REVIEWER);
		my_user4 = new User("Alan");
		my_user4.setCurrentRole(Role.PC);
		my_text1 = "abcd";
		my_text2 = "efgh";
		my_text3 = "ijkl";
		my_text4 = "mnop";
		con = new Conference();
	}
	/**
	 * Tests the AddManuscripts() method. 
	 * 
	 * @author Rithy Chhen
	 * @version 11.19.2011
	 */
	@Test
	public void testAddManuscripts() {
		//user1 is author. 
		con.addManuscript(my_user1, my_text1);
		//list should increment.
		assertEquals("if true", con.getManuscripts().size(), 1);
		//user2 is author. 
		con.addManuscript(my_user2, my_text2);
		//list should increment.
		assertEquals("if true", con.getManuscripts().size(), 2);
		//user3 and 4 are not author size of the list stayed the same. 
		con.addManuscript(my_user3, my_text3);
		con.addManuscript(my_user4, my_text4);
		
	}

}
